<?php
// +----------------------------------------------------------------------
// | Author: derek <693472824@qq.com> <http://www.bloveambition.com/>
// +----------------------------------------------------------------------

namespace Api\Controller;
use Think\Model;

/**
 * 首页控制器
 * @author derek <693472824@qq.com>
 */
class IndexController extends BaseController {
    
    /**
     * 首页
     * @author derek <693472824@qq.com>
     */
    public function index(){

        //轮播图
        $view = D('Blovex4/BannerView');
        $list = $view->limit(3)->order('banner_id DESC')->select();
        
        //顶级服务分类
        $classList = M('Class')->where(array('parent_id=0', 'show_status=1'))
                    ->order('sort_no')->getField('class_id,class_name,emergency');
        
        $this->assign('list', $list);
        $this->assign('classList', $classList);
        $this->display();
    }
    
    public function index2(){
        D('Orders', 'Logic')->ajaxDownLoad('ymC4jbeeF_ErvE0WY81krkICU-G9DpF9sqktmYD5OIkz2KDA_yA29G4ru4p8-n73.jpg');
    }
}
